<?php
class Mdata_login extends CI_Model{
	
	function Mdata_login() {
		parent::__construct();
		$this->load->library('calendar');
		$this->load->model('mmaster');
		$this->load->library('serversidedatatables');
	}
	// Jquery Data Tabel 18 Feb 2013 projack89
	function mtampil_login_logout(){
		$sIndexColumn = "NIK"; //index column untuk kecepatan akses data
        $defaultOrder = "0"; //default order berdasarkan field yg ada pada $aColumns
        $userlogin = $this->session->userdata('username'); //user credentials
        $cluster_id = $this->mglobal->user_cluster($userlogin);
        $flag = '';
		//ambil field2 dari tabel t_rpt_activity_real_time yg akan ditampilkan pada dataTables
        $aColumns = array("tanggal","Cluster","NIK","Region","Nama","Login","timestamp_login","timestamp_logout"); 
		$inputQuery = "SELECT 
		tanggal, 
		(\"Cluster\"), 
		(\"NIK\"),
		(\"Region\"),
		(\"Nama\"),
		(\"Login\"),
		timestamp_login,
		timestamp_logout
        FROM t_rpt_activity_real_time";
		return $this->serversidedatatables->executeServerSideProcess($defaultOrder, $flag, $userlogin, $inputQuery, $aColumns, $sIndexColumn, 'desc');
	}
	
}